package com.youease.chris.action
{
	import com.youease.chris.ActionQueue;
	import com.youease.chris.event.ActionEvent;
	
	import flash.events.EventDispatcher;
	
	public class BaseAction extends EventDispatcher implements IAction
	{
		
		private var _currentTimer:Number = 0;
		private var _isComplete:Boolean = false;
		
		public function BaseAction()
		{
			
		}
		
		public function execute():void {
//			this._isActive = true;
		}
		
		public function update():void {
			
		}
		
		public function complete(event:*=null):void {
			trace("action success...");
			if(!isComplete) {
				this.dispatchEvent(new ActionEvent(ActionEvent.ACTION_COMPLETE));
				isComplete = true;	
			}
		}
		
		public function deActive():void {
			
		}
		
		public function fail(event:*=null):void {
			
		}
		
		public function commit(queue:ActionQueue = null):void {
			
		}
		
		public function halt():void {
			
		}
		
		public function get currentTimer():Number {
			return this._currentTimer;
		}
		
		public function set currentTimer(c:Number):void {
			this._currentTimer = c;
		}
		
		public function set isComplete(c:Boolean):void {
			this._isComplete = c;
		}
		
		public function get isComplete():Boolean {
			return this._isComplete;
		}
	}
}